home *** CD-ROM | disk | FTP | other *** search
- global gPathName, gLastTimeRollover, gPanoFrame, gPanoCallBackFactory, gTestCallbackFactory, gNavMovieObj, gPanoMovieObj, gLastPanoMovieData, gVRSprite1, gVRSprite2, gVR, gIntroVR, gVR.PanoFilename, gVR.CurrentNodeID, gVR.CurrentHotSpotID, gVR.MouseOverHandler.Message, gVR.RolloverHotSpotHandler.Message, gVR.MouseDownHandler.Message, gVR.PanZoomStartHandler.Message, gVR.MouseStillDownHandler.Message, gVR.NodeLeaveHandler.Message
-
- on StartMovieVR256
- set gPathName to EMPTY
- set gLastTimeRollover to 0
- set gPanoFrame to EMPTY
- set gVRSprite1 to 3
- set gVRSprite2 to 4
- set gVR.PanoFilename to gIntroVR
- openXLib("QTVRW.QTC")
- set tInitObj to qtvrw(mnew, "Nav")
- if objectp(tInitObj) then
- tInitObj(mdispose)
- end if
- set gPanoCallBackFactory to SampleCallbacks(mnew)
- set gTestCallbackFactory to TestCallbacks(mnew)
- end
-
- on StartMovieVR256a
- openXLib("QTVRW.QTC")
- set tInitObj to qtvrw(mnew, "Nav")
- if objectp(tInitObj) then
- tInitObj(mdispose)
- end if
- set gPanoCallBackFactory to SampleCallbacks(mnew)
- set gTestCallbackFactory to TestCallbacks(mnew)
- end
-
- on StopMovieVR256
- ClosePanoMovie()
- CloseNavMovie()
- closeXLib("QTVRW.QTC")
- if objectp(gPanoCallBackFactory) then
- gPanoCallBackFactory(mdispose)
- end if
- if objectp(gTestCallbackFactory) then
- gTestCallbackFactory(mdispose)
- end if
- end
-
- on OpenNavMovie256 pFilename, pSpriteNum, pShowOnOpen
- CloseNavMovie()
- set gNavMovieObj to qtvrw(mnew, "Nav")
- if not objectp(gNavMovieObj) then
- put "Unable to create new Nav instance"
- beep()
- exit
- end if
- set spriteLeft to the left of sprite pSpriteNum
- set spriteTop to the top of sprite pSpriteNum
- set tResultCode to gNavMovieObj(mOpenMovie, pFilename, spriteLeft & "," & spriteTop)
- if tResultCode = 0 then
- put "Unable to open navmovie"
- gNavMovieObj(mdispose)
- beep()
- exit
- end if
- if pShowOnOpen then
- gNavMovieObj(mUpdate)
- end if
- end
-
- on ShowNavMovie256
- if objectp(gNavMovieObj) then
- gNavMovieObj(mUpdate)
- end if
- end
-
- on SetNavMovieView256 pHPan, pVPan
- if objectp(gNavMovieObj) then
- gNavMovieObj(mSetHPanAngle, string(pHPan))
- gNavMovieObj(mSetVPanAngle, string(pVPan))
- end if
- end
-
- on CloseNavMovie256
- if objectp(gNavMovieObj) then
- gNavMovieObj(mdispose)
- end if
- end
-
- on NavFrameScript256 pSpriteNum
- if objectp(gNavMovieObj) then
- if rollOver(pSpriteNum) then
- gNavMovieObj(mMouseOver)
- cursor(200)
- cursor(-1)
- else
- gNavMovieObj(mIdle)
- end if
- end if
- end
-
- on OpenPanoMovie256 pFilename, pSpriteNum, pShowOnOpen
- put pFilename, pSpriteNum, pShowOnOpen
- ClosePanoMovie()
- set gPanoMovieObj to qtvrw(mnew, "Pan")
- if not objectp(gPanoMovieObj) then
- put "Unable to create new Pan instance"
- beep()
- exit
- end if
- set spriteLeft to the left of sprite pSpriteNum
- set spriteTop to the top of sprite pSpriteNum
- set tResultCode to gPanoMovieObj(mOpenMovie, pFilename, spriteLeft & "," & spriteTop)
- if tResultCode = 0 then
- put "Unable to open panomovie"
- gPanoMovieObj(mdispose)
- beep()
- exit
- end if
- set gPathName to ExtractPathName(pFilename)
- InitPanoCallbacks()
- if pShowOnOpen then
- gPanoMovieObj(mUpdate)
- end if
- end
-
- on InitPanoCallbacks256
- if objectp(gPanoMovieObj) and objectp(gPanoCallBackFactory) then
- gPanoMovieObj(mSetMouseOverCallback, gPanoCallBackFactory, EMPTY)
- gPanoMovieObj(mSetRolloverCallback, gPanoCallBackFactory, "SampleRolloverHandler")
- gPanoMovieObj(mSetMouseDownCallback, gPanoCallBackFactory, EMPTY)
- gPanoMovieObj(mSetPanZoomStartCallback, gPanoCallBackFactory, EMPTY)
- gPanoMovieObj(mSetMouseStillDownCallback, gPanoCallBackFactory, EMPTY)
- gPanoMovieObj(mSetNodeLeaveCallback, gPanoCallBackFactory, EMPTY)
- end if
- end
-
- on ShowPanoMovie256 pQuality
- if objectp(gPanoMovieObj) then
- if not voidp(pQuality) then
- gPanoMovieObj(mSetQuality, string(pQuality))
- end if
- gPanoMovieObj(mUpdate)
- end if
- end
-
- on SetPanoNode256 pNodeID, pUpdate, pQuality
- if objectp(gPanoMovieObj) then
- if not voidp(pNodeID) then
- gPanoMovieObj(mSetNodeID, integer(pNodeID))
- end if
- if not voidp(pQuality) then
- gPanoMovieObj(mSetQuality, string(pQuality))
- end if
- if pUpdate then
- gPanoMovieObj(mUpdate)
- end if
- end if
- end
-
- on SwingPanoMovie256 pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality
- if objectp(gPanoMovieObj) then
- gPanoMovieObj(mSetZoomAngle, string(pZoom))
- gPanoMovieObj(mSetVPanAngle, string(pVPan))
- gPanoMovieObj(mSetHPanAngle, string(pHPan))
- gPanoMovieObj(mSetQuality, string(pSwingQuality))
- gPanoMovieObj(mSetTransitionMode, "swing")
- gPanoMovieObj(mSetTransitionSpeed, string(pSwingSpeed))
- gPanoMovieObj(mUpdate)
- gPanoMovieObj(mSetTransitionMode, "normal")
- if pFinalQuality <> pSwingQuality then
- gPanoMovieObj(mSetQuality, string(pSwingQuality))
- gPanoMovieObj(mUpdate)
- end if
- end if
- end
-
- on SetPanoMovieView256 pHPan, pVPan, pZoom, pQuality
- if objectp(gPanoMovieObj) then
- gPanoMovieObj(mSetZoomAngle, string(pZoom))
- gPanoMovieObj(mSetVPanAngle, string(pVPan))
- gPanoMovieObj(mSetHPanAngle, string(pHPan))
- if not voidp(pQuality) then
- gPanoMovieObj(mSetQuality, string(pQuality))
- end if
- gPanoMovieObj(mUpdate)
- end if
- end
-
- on ClosePanoMovie256
- if objectp(gPanoMovieObj) then
- gPanoMovieObj(mdispose)
- end if
- end
-
- on PanoFrameScript256 pSpriteNum
- if rollOver(pSpriteNum) then
- if objectp(gPanoMovieObj) then
- set tMouseOverResult to gPanoMovieObj(mMouseOver)
- if tMouseOverResult <> 0 then
- set tAction to item 1 of tMouseOverResult
- set tHotSpotID to item 2 of tMouseOverResult
- if tAction = "jump" then
- set gVR.CurrentNodeID to string(tHotSpotID)
- else
- if tAction = "stil" then
- set gVR.CurrentHotSpotID to string(tHotSpotID)
- else
- if tAction = "navg" then
- set gVR.CurrentHotSpotID to string(tHotSpotID)
- set tViewAngles to gPanoMovieObj(mGetNavgViewAngles)
- set tFileName to gPanoMovieObj(mGetHotSpotName)
- OpenNavMovie(gPathName & "\" & tFileName, 2, 0)
- if objectp(gNavMovieObj) then
- set gPanoFrame to marker(0)
- go("Object From Pano")
- SetNavMovieView(item 1 of tViewAngles, item 2 of tViewAngles)
- ShowNavMovie()
- end if
- else
- if tAction = "misc" then
- set gVR.CurrentHotSpotID to string(tHotSpotID)
- else
- if tAction = "undf" then
- set gVR.CurrentHotSpotID to string(tHotSpotID)
- if tHotSpotID = 1 then
- set gVR to 0
- swingPyramid()
- advanceVR("Pyramid")
- else
- if tHotSpotID = 2 then
- set gVR to 1
- swingShip()
- advanceVR("Ship")
- end if
- end if
- else
- if tAction = "pan " then
- end if
- end if
- end if
- end if
- end if
- end if
- set gLastTimeRollover to 1
- else
- cursor(200)
- cursor(-1)
- set gLastTimeRollover to 0
- end if
- end if
- else
- if gLastTimeRollover then
- cursor(200)
- cursor(-1)
- set gLastTimeRollover to 0
- if objectp(gPanoMovieObj) then
- gPanoMovieObj(mIdle)
- end if
- end if
- end if
- end
-
- on ExtractPathName256 pPathName
- set tDelimiter to "\"
- if pPathName contains tDelimiter then
- set tCharPos to length(pPathName)
- repeat while tCharPos >= 1
- if char tCharPos of pPathName = tDelimiter then
- return char 1 to tCharPos - 1 of pPathName
- end if
- set tCharPos to tCharPos - 1
- end repeat
- return EMPTY
- else
- return EMPTY
- end if
- end
-
- factory TestCallbacks
- method TestMouseOverHandler
- if objectp(gPanoMovieObj) then
- set gVR.MouseOverHandler.Message to "In mouse over at: " & the ticks
- end if
-
- method TestRolloverHotSpotHandler pHotSpotID
- if objectp(gPanoMovieObj) then
- set gVR.RolloverHotSpotHandler.Message to "Rolling over hot spot: " & pHotSpotID
- end if
-
- method TestMouseDownHandler
- if objectp(gPanoMovieObj) then
- set gVR.MouseDownHandler.Message to "In mouse down at: " & the ticks
- gPanoMovieObj(mPassMouseDown)
- end if
-
- method testPanZoomStartHandler
- if objectp(gPanoMovieObj) then
- set gVR.PanZoomStartHandler.Message to "In pan zoom start at: " & the ticks
- end if
-
- method TestMouseStillDownHandler
- if objectp(gPanoMovieObj) then
- set gVR.MouseStillDownHandler.Message to "In mouse still down at: " & the ticks
- set gVR.MouseStillDownHandler.Message to gPanoMovieObj(mGetHPanAngle)
- end if
-
- method TestNodeLeaveHandler pToNode
- if objectp(gPanoMovieObj) then
- set gVR.NodeLeaveHandler.Message to "Leaving node ID: " & pToNode
- end if
-
- factory SampleCallbacks
- method SampleMouseOverHandler
- put "Mouse over panoramic movie"
- if objectp(gPanoMovieObj) then
- end if
-
- method SampleRolloverHandler pHotSpotID
- set gVR.CurrentHotSpotID to string(pHotSpotID)
-
- method SampleMouseDownHandler
- put "Mouse down during mMouseOver call"
- if objectp(gPanoMovieObj) then
- gPanoMovieObj(mPassMouseDown)
- end if
-
- method SamplePanZoomStartHandler
- put "About to pan or zoom in panoramic movie"
-
- method SampleMouseStillDownHandler
- put "Enter mouse still down from panoramic movie"
- if objectp(gPanoMovieObj) then
- end if
- put "Leave mouse still down from panoramic movie"
-
- method SampleNodeLeaveHandler pToNode
- put "Jumping to node " & pToNode & " in panoramic movie"
-